package com.lin.spring.proxy.dynamic;

import com.lin.spring.proxy.Boss;
import com.lin.spring.proxy.Rent;

import java.lang.reflect.Proxy;

/**
 * @ClassName Customer
 * @Description
 * @Author lin
 * @Date 2021/11/11 下午10:14
 * @Version V1.0
 */
public class Customer {
    public static void main(String[] args) {
        Rent rent = (Rent)Proxy.newProxyInstance(Rent.class.getClassLoader(), new Class[]{Rent.class}, new DynamicProxy(new Boss()));
        rent.rent();


        CJlibProxy cJlibProxy = new CJlibProxy();
        // 生成真实对象的子类
        Boss boss = (Boss)cJlibProxy.getInstance(new Boss());
        boss.rent();
    }
}
